<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ page import="java.util.ArrayList"%>
<%@ page import=" java.util.List"%>
<%@ page import=" com.demo.entity.Products"%>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>商品管理-修改信息</title>
<script type="text/javascript">
    function updateCheck() {
        var pname = document.getElementById("pname");
        var pprice = document.getElementById("pprice");
        var pnum = document.getElementById("pnum");
        var pcategory = document.getElementById("pcategory");
        var pdescription = document.getElementById("pdescription");
        if(pname.value == '' && pprice.value == '' && pnum.value == '' && pcategory.value == '' &&  pdescription.value == ''){
            alert("未做任何修改 ! ");
            return false;
        }
    }
</script>
</head>
<body>
    <fieldset>
        <legend style="color: #00f" > <h4 >修改商品信息 . . . </h4></legend>
        <%
                Products pdsList =  (Products)session.getAttribute("pds");
         %>
        <form action="/WebStoreSSM/controller/updateProductAction/<%=pdsList.getProduct_id()%>" method="post" onsubmit="return updateCheck();">
            <table>
                <tr><th colspan="2" style="color: #f00">${addMessage}</th></tr>
                <tr><th>商品名 - <%=pdsList.getName()%>改为：</th><th><input type="text" name="pname" id="pname"/></th></tr>
                <tr><th>价格 - <%=pdsList.getPrice()%>改为：</th><th><input type="text" name="pprice" id="pprice"/></th></tr>
                <tr><th>库存量 - <%=pdsList.getPnum()%>改为：</th><th><input type="text" name="pnum" id="pnum"/></th></tr>
                <tr><th>类别 - <%=pdsList.getCategory()%>改为：</th><th><input type="text" name="pcategory" id="pcategory"/></th></tr>
                <tr><th>详细信息 - <%=pdsList.getDescription()%>改为：</th><th><input type="text" name="pdescription" id="pdescription"/></th></tr>

                <tr><th colspan="2" align="center"><input type="submit" value="修改"/>
                                                        <input type="reset" value="重置"/></th></tr>
                <tr><th colspan="2" align="center"><a href="/WebStoreSSM/controller/productsInfo_action">返回商品管理</a></th></tr>
            </table>
        </form>
    </fieldset>
</body>
</html>